import * as vscode from 'vscode';
import { browserStateBar } from './browser/browserStateBar';

import { createBrowserClient } from './browser/browserClient';
export function activate(context: vscode.ExtensionContext) {
	let stateBarBinding = vscode.commands.registerCommand(
		'vscodeBrowser.stateBarBrowser',
		async (url?: string | undefined) => {
			// vscode.window.showInformationMessage('Opening Browser  on stateBar');
			browserStateBar.update();
			return await createBrowserClient(context, url);
		},
	);

	const vscodeBrowser = vscode.commands.registerCommand(
		'vscodeBrowser.openInBrowser',
		async (url?: string | undefined) => {
			// vscode.window.showInformationMessage('Opening Browser');
			return await createBrowserClient(context, url);
		},
	);

	let rightUpIcon = vscode.commands.registerCommand(
		'vscodeBrowser.clickBrowserIcon',
		async (url?: string | undefined) => {
			return await createBrowserClient(context, url);
		},
	);

	context.subscriptions.push(vscodeBrowser, rightUpIcon, stateBarBinding);
}

// This method is called when your extension is deactivated
export function deactivate() {}
